
#include "HT162X_Parts.h"
#include "../Y36_LCD_horizontal/App_Main.h"
#include "../MCU_Mold/MCU_F_C_Convert.h"

#ifndef UI_H
#define UI_H


#define Alarm_Probe_Min 50


typedef enum
{
    Alarm_None = 0,
    Alarm_Timer1,
    Alarm_RTD,
    Alarm_ProbeA_Enable,
    Alarm_ProbeA_Action,
    Alarm_ProbeB_Enable,
    Alarm_ProbeB_Action,
}UI_Alarm_E;
typedef enum
{
    UI_OFF = Char_OFF,
    UI_ON = Char_ON,
}UI_State_E;
typedef enum
{
    UI_None = 0,
    UI_RTD,
    UI_RTDSettings,
    UI_Timer_Hour,
    UI_Timer_Minute,
    UI_ProbeA,
    UI_ProbeB,
    UI_PSet,
}UI_Number_E;
typedef enum
{
    Shine_All = 0, //所有段码闪耀
    Shine_Init,
    Shine_OFF, //正常不闪耀
    Shine_ON, //闪耀
}Shine_E;
typedef enum
{
    Alart_None = 0,
    Alart_Action,
}Alart_Type;
typedef struct
{
    uint32_t Actual;
    uint32_t Settings;   
    uint8_t State;
    Alart_Type Alart_State;
}UI_Param_Typedef;
typedef struct 
{
    UI_Param_Typedef Timer1;
    uint8_t Pset;
    // MCU_Time_T Timer1_T;
    Shine_E Shine_Colon;
    Shine_E Shine_WIFI;
    uint8_t ShineCtrl;

    UI_State_E State_TempCtrl;
    UI_Number_E State_Operation;
    UI_State_E ICO_WIFI;
    UI_State_E ICO_Bluetooth;
    UI_State_E ICO_Auger;
    UI_State_E ICO_Fan;
    UI_State_E ICO_Heating;
    UI_State_E ICO_Error;
    UI_State_E ICO_Cell;

    UI_Alarm_E Alarm_Timer;
    UI_Alarm_E Alarm_RTD;
    UI_Alarm_E Alarm_ProbeA;
    UI_Alarm_E Alarm_ProbeB;

    Grill_Unit_E Grill_Unit;
    UI_State_E UI_Show;
}UI_System_S;
extern UI_System_S UI_System;

extern uint16_t UI_Refresh_Count;


void UI_Encoder_KeyLong(void);
void UI_Encoder_Key(void);
void UI_Encoder_R(void);
void UI_Encoder_L(void);
void UI_Clock(void);
void UI_Init(void);
void UI_Main(void);
void UI_Shine_Exit(void);
void UI_TempCtrl_Start(void);
void UI_TempCtrl_Stop(void);

UI_State_E UI_Grill_Normal(void);
uint16_t ConvertC(uint16_t tempF);

#endif
